Release 10.1A: OpenEdge Application Server:
Developing AppServer Applications
Choosing a session model
The session model you choose determines how the AppServer services clients, and that choice depends on the type of application you want to support.
Session-managed model
The session-managed model is specifically designed for application services or Web services that support a single transaction across multiple requests from the same client, returning intermediate results with each request until the transaction is completed. Thus, the AppServer maintains context between requests for each client that it services, and each such client participates in a persistent connection to the Appserver. The connected AppServer is dedicated to serving that one client until the connection between them is terminated.
In this session model, all client requests are single-threaded, meaning that the AppServer does not handle another request from the same client until it has completed and responded to any pending request from that client.
Session-free model
The session-free model is specifically designed for application services or Web services that return a complete result, starting and ending any transactions, in a single request. Thus, the AppServer maintains no context for any client that it services. Requests from a session-free client are handled by any available AppServer (and AppServer agent) that supports the required application service. The session-free client (or the Web Services or OpenEdge Adapter for Sonic ESB on behalf of Web service clients) manages a pool of physical AppServer connections (the ) that provides access to the session-free AppServers available to service client requests. Thus, a session-free AppServer executes requests from all clients as it receives them, and completes each request independently of any prior request (see the "State-free operating mode" section).
In this session model, all requests from a client are multi-threaded, meaning that multiple requests from a single client can be executed in parallel, as AppServer resources permit. The more AppServers (and AppServer agents) that are available (through a NameServer) to handle requests for a given application service (or Web service), the more requests that the application or Web service can handle simultaneously from a single client. Each session-free AppServer executes requests as fast as communications and AppServer agent resources permit. Thus, the same client can have multiple requests executed by an AppServer at one time, and each AppServer can execute requests from any number of clients at one time, both limited by the number and extent of AppServer agents configured for each AppServer.
Making the final choice
As an aid to choosing a session model, Table 1–1 shows major points of comparison between the session-free and session-managed models.
Thus, if your application requires the AppServer to manage context for its clients, choose a session-managed operating mode (stateless, state-aware, or state-reset). Also, if you are Web service-enabling an existing AppServer application that relies on a specific operating mode, you must continue to use that mode for the Web service unless you make the necessary changes in the application to use another operating mode.
If your application requires no context management on the AppServer and otherwise has no programming dependency on a session-managed operating mode, you can choose the session-free operating mode (state-free). For an existing session-managed AppServer application that meets these requirements (maintains no context), you can immediately change the AppServer operating mode to state-free with no code changes, thus converting the entire application to a session-free model with potentially greater performance benefits.
Note: If you do convert an existing AppServer application from the session-managed to the session-free model, be sure to set any AppServer instances that support the same application service to the state-free operating mode.If you can use the session-free operating model, it has the following advantages over the session-managed model:
For more information on programming:
- Session-free and session-managed AppServers, see Chapter 2, " Programming the AppServer."
- Session-free and session-managed Progress 4GL clients, see Chapter 3, " Programming Progress 4GL Client Applications."
- Session-free and session-managed Open Clients, see OpenEdge Development: Open Client Introduction and Programming .
Note: If your aim in choosing the session-free model is greater scalability and performance, and you also require secure connections, note that using either (or both) the AIA with HTTPS or an SSL-enabled AppServer tends to incur heavy performance penalties regardless of the session model that you choose. For more information, see the sections on security considerations in Chapter 4, " Design and Implementation Considerations."- Session-free and session-managed Web service clients of Progress 4GL Web services, see OpenEdge Development: Web Services .
Whatever session model your AppServer application supports, you must also perform these tasks for a Web service:
- Specify the same session model for any Web service definition based on the same application service. For more information on specifying the session model for a Web service definition using ProxyGen, see OpenEdge Development: Open Client Introduction and Programming .
- Manage the Web service through the WSA (or OpenEdge Adapter for Sonic ESB) according to the same session model. For more information on managing Web services for a given session model, see the chapters on Web service management and deployment in OpenEdge Application Server: Administration .
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |